# region Copyright
//===================================================================================
// TrackerRealm Corporation for .NET
//    
// ErrorForm.aspx.cs
//
//====================================================================================
// Copyright (C) 2004 TrackerRealm Corporation
// All rights reserved.
// THIS CODE AND INFORMATION IS THE PROPERTY OF TrackerRealm Corporation.
// IT MAY NOT BE COPIED FOR ANY PURPOSE.
//
// REMOVAL OF THIS NOTICE IS VIOLATION OF THE COPYRIGHT.
//====================================================================================
# endregion

using System;
using System.Web.UI;

namespace TrackerRealm.Jetfire.Web
{
	/// <summary>
	/// ErrorForm.
	/// </summary>
	public partial class ErrorForm : Page
	{
		# region Form Variables and Constructor
		protected void Page_Load(object sender, System.EventArgs e)
		{
			try
			{
				System.Collections.Specialized.NameValueCollection coll = Request.QueryString;
				string error = coll.Get("error");
				// If there is no 
				if (error == null || error == "")
				{
					error = "Your session has expired. If you are seeing this message immediately after accessing a page from TrackerRealm, check that you have cookies enabled.";
					this.Response.Redirect("../Default.aspx");
				}
				this.ErrorMessage.Text = error;
				this.LabelError.Text = "You have reached this page through an error."
					+ Environment.NewLine + "Read the following text and attempt to correct the error."
					+ Environment.NewLine + "Then try again.  If this error persists, please forward this information to <a href='mailto: Webmaster@TrackerRealm.ca?Subject=Web page error'>Webmaster@TrackerRealm</a>.";
				// Setup the Top Menu
			//	this.TrPage.SetupTopMenu(this.PanelMenu, WebMenuType.LoggedInMenu);
			}
			catch (System.Threading.ThreadAbortException)
			{	// ignore
			}
			catch (Exception)
			{	// Cannot do much but ignore Error, since This redirecting to Error page creates loop
			}
		}
		# endregion
	}
}